<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>用函数比较两个数大小</title>
	</head>
	<body>
		<script>
			function getMax(x,y){
				if(x>y){
					return x;
				}else{
					return y;
				}
			}
			var max = getMax(22,4);
			alert(max);
		</script>
	</body>
</html>
